<%@ taglib uri="http://struts.apache.org/tags-bean" prefix="bean" %>
<%@ taglib uri="http://struts.apache.org/tags-html" prefix="html" %>
<%@ taglib uri="http://struts.apache.org/tags-logic" prefix="logic" %>
<%@ taglib uri="http://struts.apache.org/tags-nested" prefix="nested" %>

 <html:form action="/madmin" >
   <table border="0" align="center" width="100%">
   		<tr>
   			<td width="3%">&nbsp;</td>
   			<td width="94%">
   				<table border="0" align="center" width="100%">
			       <tr>
			           <td class="title">Mad Min Math - Scores</td>
			       </tr> 
			       <tr>
			           <td>
			              Click here <a class="bluelink" href="<%=request.getContextPath()%>/madmin.do?action=home">here</a> to do it again.
			           </td>
			       </tr>
			
			       <tr>
			           <td>
			               <table border="1" width="85%" bordercolor="#cecde6" cellpadding="2" cellspacing="0">
			                  <tr>
			                     <td colspan="7">
			                        <table>
			                           <tr>
			                              <td class="formLabel">Correct Answers: </td>
			                              <td class="formValue"><bean:write name="mmaf" property="score.correctQs"/></td>
			                           </tr>
			                           <tr>
			                              <td class="formLabel">Wrong Answers: </td>
			                              <td class="formValue"><bean:write name="mmaf" property="score.wrongQs"/></td>
			                           </tr>
			                           <tr>
			                              <td class="formLabel">Percentage: </td>
			                              <td class="formValue"><bean:write name="mmaf" property="score.percentage" />%</td>
			                           </tr>      
			                        </table>
			                     </td>
			                  </tr>                
			                  <tr>
			                     <td class="tableHeader" width="7%" nowrap>Sum#</td>
			                     <td class="tableHeader"  width="30%">Sum</td>
			                     <td class="tableHeader" width="15%">Is Correct?</td>
			                     <td class="tableHeader" width="20%" nowrap>Your Answer</td>
			                     <td class="tableHeader" width="28%">Actual Answer</td>
			                  </tr>                  
			                  <nested:iterate name="mmaf" property="score.data" indexId="count1" type="java.util.List">
			                  <%
			                      int counter = count1.intValue() + 1;
			                      String rowclass = "evenRow";
			                      if(counter%2 == 0) {
			                          rowclass = "oddRow";
			                      }
			                      
			                   %>
			                  <tr class="<%=rowclass%>">
			                     <td class="formValue" width="7%" nowrap><%=counter%></td>
			                     <td class="datacenter" width="30%" align="left"><nested:write property="question" filter="false"/><font color="red">?</font></td>
			                     <td class="formValue" width="15%"><nested:write property="isCorrect"/></td>
			                     <td class="formValue" width="20%"><nested:write property="displayUserAnswer"/></td>
			                     <td class="formValue" width="28%"><nested:write property="displayActualAnswer"/></td>
			                  </tr>
			                  </nested:iterate>
			               </table>
			           </td>
			       </tr>   				
   				</table>
   			</td>
   			<td width="3%">&nbsp;</td>
   		</tr>


   </table>  
 </html:form>
